package com.openharmony.filepicker.filetype;


import com.openharmony.filepicker.ResourceTable;

public class VideoFileType extends FileType {

    public VideoFileType() {
        this.setFileType("Video");
        this.setFileIconResId(ResourceTable.Media_ic_video_file_picker);
    }

    @Override
    public boolean verify(String fileName) {
        boolean isHasSuffix = fileName.contains(".");
        if (!isHasSuffix) {
            return false;
        }
        String suffix = fileName.substring(fileName.lastIndexOf(".") + 1);

        switch (suffix) {
            case "mp4":
            case "mkv":
            case "mov":
            case "mpg":
            case "mpeg":
            case "3gp":
            case "3gpp":
            case "3g2":
            case "3gpp2":
            case "webm":
            case "ts":
            case "avi":
            case "flv":
            case "swf":
            case "wmv":
            case "vob":
            case "m4v":
                return true;
            default:
                return false;
        }
    }
}
